package com.rfsp.mcp.controller.hos;

import com.rfsp.common.base.ResultVO;
import com.rfsp.common.log.TrcMsg;
import com.rfsp.common.pojo.sdto.PageSDTO;
import com.rfsp.common.service.UserService;
import com.rfsp.common.shiro.ShiroUtils;
import com.rfsp.common.util.DateUtil;
import com.rfsp.common.util.StringUtil;
import com.rfsp.common.util.XssUtils;
import com.rfsp.mcp.enums.MiPayDataTypeEnum;
import com.rfsp.mcp.pojo.dto.*;
import com.rfsp.mcp.pojo.po.OrgYbjPO;
import com.rfsp.common.pojo.po.UserPO;
import com.rfsp.mcp.pojo.sdto.*;
import com.rfsp.mcp.pojo.vo.*;
import com.rfsp.mcp.service.*;
import com.rfsp.mcp.service.interfaceclient.WSMiAccountService;
import com.rfsp.mcp.service.interfaceclient.WSMiPayService;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.github.pagehelper.PageInfo;
import com.rfsp.common.base.ResultListVO;

import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequiresRoles(value={"mcp_hos"}, logical= Logical.AND)
@Controller("HosPayLogController")
@RequestMapping("/hos/payLog")
public class HosPayLogController extends HosController {
    public Logger logger = LoggerFactory.getLogger(HosPayLogController.class);

    private static final String LDJG_COUNT_LIMIT_PROMPT = "今日次数已用尽，明日再进行查询！";

    private static final String QUERY_REASON = "用户自查";

    @Autowired
    PayLogService payLogService;

    @Autowired
    HospitalService hospitalService;

    @Autowired
    OrgYbjService ybjService;

    @Autowired
    PayService payService;

    @Autowired
    NhcJssqService nhcService;

    @Autowired
    OrgYbjService ybjSerivce;

    @Autowired
    PfmService pfmService;

    @Autowired
    UserService userService;

    @Autowired
    private WSMiPayService wsMiPayService;
    @Autowired
    private WSMiAccountService wsMiAccountService;

    @RequestMapping("/")
    public String index1(ModelMap model, PageSDTO pageSdto, MiPayLogSDTO sdto) {
        return index(model,pageSdto,sdto);
    }


    @RequestMapping("/index")
    public String index(ModelMap model, PageSDTO pageSdto, MiPayLogSDTO sdto) {
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.index"));

        sdto=XssUtils.replaceXss(sdto);

        PageInfo<MiPayLogVO> list = payLogService.getByAuthId(sdto.getAuthId(), pageSdto);
        sdto=XssUtils.replaceUnXss(sdto);
        ResultListVO<MiPayLogVO> vo = ResultListVO.success(list,sdto);
        model.put("vo", vo);
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "HosPayLogController.index"));
        return "hos/payLog/index";
    }


    @GetMapping("/updateAll")
    public String updateAllForm(ModelMap model,@ModelAttribute("dto") HosMiPayLogDTO sourceDto,BindingResult bindingResult) {
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.updateAllForm"));
        sourceDto=XssUtils.replaceXss(sourceDto);

        model.put("dto",sourceDto);

        UserPO userPO = ShiroUtils.getCurrentUser();
        if(StringUtils.isBlank(userPO.getCaSubjection())) {
            sourceDto.setBindCfca("1");
        }

        ResultVO<HosMiPayLogDTO> result = ResultVO.success(sourceDto);
        model.put("result",result);
        if(bindingResult.hasErrors()) {
            result.setMsg("操作失败");
        }

//        PfmSDTO pfmSdto=new PfmSDTO();
//        List<PfmVO> pfmList = pfmService.get(pfmSdto);
//        pfmService.combo(pfmList);
//        model.put("pfmList",pfmList);
        PfmVO pfm = ShiroUtils.getAttribute("mcp_pfm");
        pfmService.combo(pfm);
        model.put("pfmVo",pfm);

        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "HosPayLogController.updateAllForm"));
        return "hos/payLog/updateAllForm";
    }

    @GetMapping("/updateAllFs")
    public String updateAllFormFs(ModelMap model, @ModelAttribute("dto") HosMiPayLogFsDTO sourceDto, BindingResult bindingResult) {
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.updateAllFormFs"));

        sourceDto=XssUtils.replaceXss(sourceDto);

        model.put("dto",sourceDto);

        ResultVO<HosMiPayLogFsDTO> result = ResultVO.success(sourceDto);
        model.put("result",result);
        if(bindingResult.hasErrors()) {
            result.setMsg("操作失败");
        }
        PfmVO pfm = ShiroUtils.getAttribute("mcp_pfm");
        pfmService.combo(XssUtils.replaceUnXss(pfm));
        model.put("pfmVo",pfm);

        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "HosPayLogController.updateAllFormFs"));
        return "hos/payLog/updateAllFormFs";
    }

    @Value("${mcp.file-path-paylog}")
    private String filePath;

    @PostMapping("/updateAll")
    public String updateAll(ModelMap model,@ModelAttribute("dto") @Valid HosMiPayLogDTO sourceDto,BindingResult bindingResult) {
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.updateAll"));
        // 检查验证错误
        if (bindingResult.hasErrors()) {
            // 可添加额外处理
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "HosPayLogController.updateAll"));
            List<ObjectError> allErrors = bindingResult.getAllErrors();
            StringBuffer errorMsg = new StringBuffer();
            for (ObjectError allError : allErrors) {
                errorMsg.append(allError.getDefaultMessage());
            }
            return updateAllForm(model,sourceDto,bindingResult);
        }
        sourceDto=XssUtils.replaceXss(sourceDto);

        UserPO currentUser = ShiroUtils.getCurrentUser();



        MiPayLogSDTO sdto=new MiPayLogSDTO();
        sdto.setQueryOrgId(currentUser.getOrgId());
        sdto.setTargetOrgId(currentUser.getOrgId());

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String date=sdf.format(new Date());
        sdto.setQueryTimeStart(date+" 00:00:00");
        sdto.setQueryPayState("1");
        PfmVO pfm = ShiroUtils.getAttribute("mcp_pfm");
        //查询医保关联信息
        //OrgYbjPO ybj=ybjSerivce.getYbjId(currentUser.getOrgId(), pfm.getId());
        OrgYbjPO orgYbjPO = ShiroUtils.getAttribute("org_ybj");
        OrgYbjPO ybj = ybjSerivce.getOrgYbj(orgYbjPO.getId(), orgYbjPO.getAid());
        if(ybj==null){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
            bindingResult.addError(new FieldError("dto", "global", "查询失败,未找到医保关联信息"));
            return updateAllForm(model,sourceDto,bindingResult);
        }
        if(ybj.getOrgNo()==null || "".equals(ybj.getOrgNo())){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
            bindingResult.addError(new FieldError("dto", "global", "查询失败,未找到医保关联信息"));
            return updateAllForm(model,sourceDto,bindingResult);
        }
        sdto.setOrgYbjId(ybj.getId());
        List<MiPayLogVO> voList=payLogService.get(sdto);
        if(voList.size()>=3){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
            bindingResult.addError(new FieldError("dto", "global", "今日查询次数已用尽，请明日再次提交！"));
            return updateAllForm(model,sourceDto,bindingResult);
        }

        MiPayLogDTO dto=new MiPayLogDTO();
        dto.setPfmId(pfm.getId());
        dto.setQueryReason(sourceDto.getQueryReason());
        dto.setQueryOrgId(currentUser.getOrgId());
        dto.setQueryUsrId(currentUser.getId());
        dto.setTargetOrgId(currentUser.getOrgId());
        dto.setOrgYbjId(ybj.getId());


        dto.setAuthId(0L);
        dto.setOptUserId(currentUser.getId());
        dto.setOptType("1");
        dto.setOptTime(new Date());

        dto.setQueryPayState("0");

        //清理查询记录
        clearPayLog(dto.getQueryOrgId(),dto.getTargetOrgId());

        Integer count=payLogService.saveMiPayLog(dto, null);
        if(count==0){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
            //return this.alertBack(model,"创建查询失败！如有疑问请致电平台客服电话400-009-0001。");
            bindingResult.addError(new FieldError("dto", "global", "创建查询失败！如有疑问请致电平台客服电话400-009-0001。"));
            return updateAllForm(model,sourceDto,bindingResult);
        }
        Integer payCount=0;
        Long id=dto.getId();
        String fileName=id+".txt";
        String filePath = this.filePath.replaceFirst("date/", StringUtil.dateToString(new Date(), "yyyy/MM/dd/"));

        HospitalVO hospital=hospitalService.getById(dto.getTargetOrgId());

        try{
            NhcJssqSDTO sdto1=new NhcJssqSDTO();
            sdto1.setIdNo(ybj.getOrgNo());
            ResultVO<List<NhcJssqVO>> result1=nhcService.query(sdto1,hospital.getOrgCode(),filePath,fileName);
            if(!"000000".equals(result1.getCode())){
                logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
                //return this.alertBack(model,"医保结算信息查询失败，请稍后查询！如有疑问请致电平台客服电话400-009-0001。");
                bindingResult.addError(new FieldError("dto", "global", "医保结算信息查询失败，请稍后查询！如有疑问请致电平台客服电话400-009-0001。"));
                return updateAllForm(model,sourceDto,bindingResult);
            }
            ResultVO<List<NhcJssqVO>> result2=nhcService.filter(result1,sdto1.getIdNo());
            List<MiPayDTO> payList=nhcService.getList(result2.getData());
            payCount=payService.createByPayLog(dto,payList);
            if(payCount>0) {
                MiPayLogDTO updateDto = new MiPayLogDTO();
                updateDto.setQueryPayState("1");
                updateDto.setFilePath(filePath + fileName);
                payLogService.updateById(id, updateDto);
            }
        }catch (Exception ex){
            log.error(ex.getMessage());
        }
        if(payCount==0){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAll"));
            //return this.alertBack(model,"未查询到相关的医保结算信息，请稍后查询！如有疑问请致电平台客服电话400-009-0001。");
            bindingResult.addError(new FieldError("dto", "global", "未查询到相关的医保结算信息，请稍后查询！如有疑问请致电平台客服电话400-009-0001。"));
            return updateAllForm(model,sourceDto,bindingResult);
        }
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "HosPayLogController.updateAll"));
        //return this.alertContentReload(model,"更新成功");
        return this.alertParentLocation(model,"更新成功","/mcp/hos/pay/");
    }

    @PostMapping("/updateAllFs")
    public String updateAllFs(ModelMap model,@ModelAttribute("dto") HosMiPayLogFsDTO sourceDto,BindingResult bindingResult) {
        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.updateAllFs"));
        //入参验证
        if (StringUtils.isBlank(sourceDto.getDataType())) {
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
            bindingResult.addError(new FieldError("dto", "global", "请勾选查询内容"));
            return updateAllFormFs(model,sourceDto,bindingResult);
        }
        if (sourceDto.getDataType().contains(MiPayDataTypeEnum.MI_PAY.getKey())) {
            if (StringUtils.isBlank(sourceDto.getPayStartDate()) && StringUtils.isNotBlank(sourceDto.getPayEndDate())) {
                logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                bindingResult.addError(new FieldError("dto", "global", "请勾选结算起始日期"));
                return updateAllFormFs(model,sourceDto,bindingResult);
            }
            if (StringUtils.isNotBlank(sourceDto.getPayStartDate()) && StringUtils.isBlank(sourceDto.getPayEndDate())) {
                logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                bindingResult.addError(new FieldError("dto", "global", "请勾选结算结束日期"));
                return updateAllFormFs(model,sourceDto,bindingResult);
            }
            if (StringUtils.isNotBlank(sourceDto.getPayStartDate()) && StringUtils.isNotBlank(sourceDto.getPayEndDate())) {
                LocalDate payStartDate = DateUtil.parseLocalDateByYYYYMMDD(sourceDto.getPayStartDate());
                LocalDate payEndDate = DateUtil.parseLocalDateByYYYYMMDD(sourceDto.getPayEndDate());
                if (payStartDate.isAfter(payEndDate)) {
                    logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                    bindingResult.addError(new FieldError("dto", "global", "开始日期不能晚于结束日期"));
                    return updateAllFormFs(model,sourceDto,bindingResult);
                }
                LocalDate localDate = payStartDate.plusYears(1).minusDays(1);
                if (localDate.isBefore(payEndDate)) {
                    logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                    bindingResult.addError(new FieldError("dto", "global", "输入时间请小于1年！"));
                    return updateAllFormFs(model,sourceDto,bindingResult);
                }
                //前年一月一号日期
                LocalDate localDate1 = LocalDate.now().minusYears(2).withMonth(1).withDayOfMonth(1);
                if (payEndDate.isBefore(localDate1)) {
                    logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                    bindingResult.addError(new FieldError("dto", "global", "平台支持查询前年1月1日至今的结算数据"));
                    return updateAllFormFs(model,sourceDto,bindingResult);
                }
            }
            if (StringUtils.isBlank(sourceDto.getPayStartDate()) && StringUtils.isBlank(sourceDto.getPayEndDate())) {
                //如用户未填写起止时间，默认为截止日期当期日期，例2025-08-22，起始日期为2024-08-23
                sourceDto.setPayStartDate(DateUtil.parseStrByYYYYMMDD(LocalDate.now().minusYears(1).plusDays(1)));
                sourceDto.setPayEndDate(DateUtil.parseDateToStrByYYYYMMDD(new Date()));
            }
        }else {
            sourceDto.setPayStartDate("");
            sourceDto.setPayEndDate("");
        }
        //查询两定机构限制次数
        Integer count = Integer.parseInt(payLogService.getLDJGCountLimit());
        UserPO currentUser = ShiroUtils.getCurrentUser();
        PfmVO pfm = ShiroUtils.getAttribute("mcp_pfm");

        //医疗机构代
        //机构ID-查询自己的
        OrgYbjPO ybjPO = ShiroUtils.getAttribute("org_ybj");
        OrgYbjPO ybj = ybjSerivce.getOrgYbj(ybjPO.getId(), ybjPO.getAid());
        if (ybj == null) {
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
            bindingResult.addError(new FieldError("dto", "global", "查询失败,未找到医保关联信息"));
            return updateAllFormFs(model,sourceDto,bindingResult);
        }
        if(ybj.getOrgNo()==null || "".equals(ybj.getOrgNo())){
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
            bindingResult.addError(new FieldError("dto", "global", "查询失败,未找到医保关联信息"));
            return updateAllFormFs(model,sourceDto,bindingResult);
        }

        MiPayLogDTO dto=new MiPayLogDTO();
        dto.setPfmId(pfm.getId());
        dto.setOrgYbjId(ybj.getId());
        dto.setQueryReason(QUERY_REASON);
        dto.setQueryOrgId(currentUser.getOrgId());
        dto.setQueryUsrId(currentUser.getId());
        dto.setTargetOrgId(currentUser.getOrgId());
        dto.setAuthId(0L);
        dto.setOptUserId(currentUser.getId());
        dto.setOptType("1");
        dto.setQueryPayState("0");
        dto.setDataType(sourceDto.getDataType());
        dto.setPayStartDate(sourceDto.getPayStartDate());
        dto.setPayEndDate(sourceDto.getPayEndDate());
        dto.setItfType(pfm.getItfType().trim());
        Map<String, Boolean> map = new HashMap<>();
        //次数限制判断
        boolean accountTime = false;
        if (sourceDto.getDataType().contains(MiPayDataTypeEnum.MI_ACCOUNT.getKey())) {
            Integer ybzhcount = payLogService.getYBZHSearchSuccessCount(DateUtil.parseStrByYYYYMMDD(LocalDate.now()), DateUtil.parseStrByYYYYMMDD(LocalDate.now().plusDays(1)), dto.getQueryOrgId(), dto.getTargetOrgId(), ybj.getId()); //医保账户信息
            if (ybzhcount >= count) {
                accountTime = true;
            }
        }
        map.put(MiPayDataTypeEnum.MI_ACCOUNT.getKey(), accountTime);
        boolean payTime = false;
        if (sourceDto.getDataType().contains(MiPayDataTypeEnum.MI_PAY.getKey())) {
            Integer jsmxcount = payLogService.getJSMXSearchSuccessCount(DateUtil.parseStrByYYYYMMDD(LocalDate.now()), DateUtil.parseStrByYYYYMMDD(LocalDate.now().plusDays(1)), dto.getQueryOrgId(), dto.getTargetOrgId(), ybj.getId()); //结算明细
            if (jsmxcount >= count) {
                payTime = true;
            }
        }
        map.put(MiPayDataTypeEnum.MI_PAY.getKey(), payTime);
        String dataType = dto.getDataType();
        String[] split = dataType.split("\\,");
        //次数限制判断:无论选几个都超次数提示，如果选两个及以上，有一个不超不提示
        if (split.length == 1) {
            if (map.get(MiPayDataTypeEnum.MI_ACCOUNT.getKey()) ||
                    map.get(MiPayDataTypeEnum.MI_PAY.getKey())) {
                logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                bindingResult.addError(new FieldError("dto", "global", LDJG_COUNT_LIMIT_PROMPT));
                return updateAllFormFs(model,sourceDto,bindingResult);
            }
        }
        if (split.length == 2) {
            if (map.get(MiPayDataTypeEnum.MI_ACCOUNT.getKey()) && map.get(MiPayDataTypeEnum.MI_PAY.getKey())) {
                logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
                bindingResult.addError(new FieldError("dto", "global", LDJG_COUNT_LIMIT_PROMPT));
                return updateAllFormFs(model,sourceDto,bindingResult);
            }
        }
        //保存log记录数据
        Integer num=payLogService.saveMiPayLog(dto, map);
        if (num == 0) {
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
            bindingResult.addError(new FieldError("dto", "global", "创建查询失败！如有疑问请致电平台客服电话400-009-0001。"));
            return updateAllFormFs(model,sourceDto,bindingResult);
        }
        Long id=dto.getId();
        //调取接口
        boolean accountType = false;
        boolean payType = false;
        String dataType2 = "1";
        String dataType3 = "1";
        if (sourceDto.getDataType().contains(MiPayDataTypeEnum.MI_ACCOUNT.getKey()) && !map.get(MiPayDataTypeEnum.MI_ACCOUNT.getKey())) {
            MiAccountInfoDto miAccountInfoDto =new MiAccountInfoDto();
            miAccountInfoDto.setLogId(id);
            miAccountInfoDto.setPfmId(dto.getPfmId());
            miAccountInfoDto.setMiOrgId(dto.getTargetOrgId());
            miAccountInfoDto.setMiOrgCode(ybj.getOrgNo());
            ResultVO<String> stringResultVO = wsMiAccountService.queryMiAccountInfo(miAccountInfoDto);
            if ("200".equals(stringResultVO.getCode())) {
                accountType = true;
            }else {
                dataType2 = "0";
            }
        }
        if (sourceDto.getDataType().contains(MiPayDataTypeEnum.MI_PAY.getKey()) && !map.get(MiPayDataTypeEnum.MI_PAY.getKey())) {
            MiPayInfoDto miPayInfoDto=new MiPayInfoDto();
            miPayInfoDto.setPfmId(dto.getPfmId());
            miPayInfoDto.setLogId(id);
            miPayInfoDto.setMiOrgId(dto.getTargetOrgId());
            miPayInfoDto.setMiOrgCode(ybj.getOrgNo());
            miPayInfoDto.setPayStartDate(dto.getPayStartDate());
            miPayInfoDto.setPayEndDate(dto.getPayEndDate());
            miPayInfoDto.setOptUserId(currentUser.getId());
            ResultVO<String> stringResultVO = wsMiPayService.queryMiPayInfo(miPayInfoDto);
            if ("200".equals(stringResultVO.getCode())) {
                payType = true;
            }else {
                dataType3 = "0";
            }
        }
        //勾选复选框有一个成功则更新成功状态
        if (accountType || payType) {
            MiPayLogDTO updateDto = new MiPayLogDTO();
            updateDto.setQueryPayState("1");
            if ("0".equals(dataType2)) {
                updateDto.setDataType2(dataType2);
            }
            if ("0".equals(dataType3)) {
                updateDto.setDataType3(dataType3);
            }
            payLogService.updateById(id, updateDto);
        }else {
            logger.info(TrcMsg.getMsg(TrcMsg.METHOD_END, "updateAllFs"));
            bindingResult.addError(new FieldError("dto", "global", "创建查询失败！如有疑问请致电平台客服电话400-009-0001。"));
            return updateAllFormFs(model,sourceDto,bindingResult);
        }

        logger.info(TrcMsg.getMsg(TrcMsg.METHOD_BEGIN, "HosPayLogController.updateAllFs"));
        return this.alertParentLocation(model,"更新成功","/mcp/hos/pay/");
    }

    private Integer clearPayLog(Long queryOrgId,Long targetOrgId){
        MiPayLogSDTO sdto=new MiPayLogSDTO();
        sdto.setQueryOrgId(queryOrgId);
        sdto.setTargetOrgId(targetOrgId);
        sdto.setState("1");
        List<MiPayLogVO> voList = payLogService.get(sdto);
        Integer count=0;
        MiPayLogDTO dto=new MiPayLogDTO();
        for(MiPayLogVO vo:voList){
            dto=new MiPayLogDTO();
            dto.setState("2");
            //count+=payLogService.deleteById(vo.getId());
            count+=payLogService.updateById(vo.getId(),dto);
            payService.deleteByPayLogId(vo.getId());
        }
        return count;
    }
}